home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 12.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-06-11  |  3.4 KB  |  183 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicAName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. line = readln(TempFile)
  29. Color = strip(line)
  30. line = readln(TempFile)
  31. XOff = strip(line)
  32. line = readln(TempFile)
  33. YOff = strip(line)
  34. line = readln(TempFile)
  35. BrushName = strip(line)
  36. line = readln(TempFile)
  37. BlendNum = strip(line)
  38. call close TempFile
  39.  
  40. Frames = (End - Start)+1
  41. j=0
  42. k=0
  43. TFrames = Frames
  44. TNum = 3
  45. if TFrames > 999 then TNum = 4
  46. if TFrames > 9999 then TNum = 5
  47. if Field = 1 then TFrames = Frames*2
  48. do i = Start to End
  49.     k = k+ 1
  50.     call open TempFile,"RAM:VFXNums",W
  51.     call writeln TempFile,right(k,5,'0')
  52.     call writeln TempFile,right(Frames,5,'0')
  53.     call close TempFile
  54.     f=0
  55.     Redraw Off
  56.     j = j+ 1
  57.     FieldSet = 0
  58.     call DoIt()
  59.     Redraw On
  60.     call SaveIt()
  61.         if Field = 1 then do
  62.             Redraw Off
  63.             j = j + 1
  64.             FieldSet = 1
  65.             call DoIt()
  66.             Redraw On
  67.             call SaveIt()
  68.             end 
  69.     end
  70.     Undo On
  71. exit
  72.  
  73.  
  74.  
  75. LoadA:
  76.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  77.         Undo On
  78.         exit
  79.         end
  80.     if IAType = 0 then do
  81.         LoadBuffer PicAName Force i
  82.         if Field = 1 then do
  83.             GetMain
  84.             parse var result Name Width Height Blah
  85.             if FieldSet = 0 then do
  86.                 Hook DeInterlace
  87.                 Scale Width Height
  88.                 end
  89.             if FieldSet = 1 then do
  90.                 Hook DeInterlace
  91.                 Swap
  92.                 Scale Width Height
  93.                 end
  94.             end
  95.         end
  96.     if IAType = 1 then do
  97.         LoadBuffer PicAName Force 1
  98.         end
  99.     if IAType = 2 then do
  100.         LoadBuffer PicAName Force
  101.         end
  102.     if IAType = 3 then do
  103.         LoadBuffer PicAName""right(i,TNum,'0') Force
  104.         end
  105. return
  106.  
  107.  
  108. SaveIt:
  109.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  110.         Undo On
  111.         exit
  112.         end
  113.     if SaveType = 0 then do
  114.         call Switcher(TOSW)
  115.         call Switcher(MDV1)
  116.  
  117.         Render Go
  118.         if Field = 1 then
  119.                 call RecordAdd(SaveName,1,6,Compression)
  120.         else
  121.                 call RecordAdd(SaveName,2,6,Compression)
  122.         if j = TFrames then
  123.             call MakeIcon(SaveName,(Frames-10))
  124.         end
  125.  
  126.     if SaveType = 1 then do
  127.         if Field = 1 then do
  128.             f= f + 1
  129.             if f = 1 then
  130.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  131.             if f = 2 then do
  132.                 GetMain
  133.                 parse var result Name Width Height Blah
  134.                 Scale Width Height/2
  135.                 Swap
  136.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  137.                 Scale Width Height/2
  138.                 Hook Interlace
  139.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  140.                 f = 0
  141.                 end
  142.             end
  143.         else do
  144.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  145.             end    
  146.         end
  147.  
  148. return
  149.  
  150.  
  151. DoIt:
  152.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  153.         Undo On
  154.         exit
  155.         end
  156.     call LoadA()
  157.     GetMain
  158.     parse var result Name Width Height Blah
  159.     if j = 1 then do
  160.         LoadBrush BrushName
  161.         SaveBrushAs "ILBM" "VFXIFX:TempDrawer/BrushA" 
  162.         end
  163.     if j > 1 then do
  164.         LoadBrush "VFXIFX:TempDrawer/BrushA" 
  165.         Roll XOff YOff
  166.         SaveBrushAs "ILBM" "VFXIFX:TempDrawer/BrushA" 
  167.         end
  168.  
  169.     Blend BlendNum
  170.     FillMode Tile 0 0 0 Smooth
  171.     FilledBox 0 0 Width Height
  172.     FillMode Solid 0 0 0 Smooth
  173.     DrawMode Colorize
  174.     ActiveColor Color
  175.     FilledBox 0 0 Width Height
  176.     ActiveColor 1
  177.     DrawMode Normal
  178.     Blend 100
  179.  
  180. return
  181.  
  182.  
  183.